package com.book.oauth.server.company.hystrix.impl;

import com.book.common.api.impl.BaseHystrixImpl;
import com.book.oauth.server.company.dto.CompanyDto;
import com.book.oauth.server.company.vo.CompanyVo;
import com.book.oauth.server.company.hystrix.ICompanyHystrix;
import feign.hystrix.FallbackFactory;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

/**
 * Description：公司 HystrixImpl
 * @Author： leo
 * @CreateDate： 2020-12-31
 * @Email： leo.xiong@suyun360.com
 * Version: 1.0
 */
@Slf4j
@Component
public class CompanyHystrixImpl extends BaseHystrixImpl<CompanyDto, CompanyVo> implements FallbackFactory<ICompanyHystrix>, ICompanyHystrix {

    @Override
    public ICompanyHystrix create(Throwable e) {
        log.error("oauth-server.CompanyHystrixImpl.公司服务调用失败:{}", e.getMessage());
        e.printStackTrace();
        return new CompanyHystrixImpl();
    }
}
